package com.hliushi.demo.config;

import com.hliushi.demo.utils.key.KeyGenerator;
import com.hliushi.demo.utils.key.SnowflakeGenerator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * 基础中心配置
 *
 * @author llhuang10
 * @date 2021/7/21 11:04
 */
@Configuration
@EnableScheduling
public class BaseConfiguration {


    /**
     * 使用雪花算法, 生成唯一Key
     *
     * @param
     * @return
     */
    @Bean
    public KeyGenerator keyGenerator() {
        return new SnowflakeGenerator();
    }
}
